package com.tencent.iov.cowin.befsale.clue.repository.clue;

import com.github.pagehelper.Page;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.request.ClueExpireRequest;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.request.QueryClueCustomerCollectAllRequest;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.ClueDistributeResponse;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.ClueExpirePesponse;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.ClueFollowHeadTypeResponse;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.CountDateResponse;
import com.tencent.iov.cowin.befsale.clue.controller.cus.vo.request.ClueIntentionGradeDataRequest;
import com.tencent.iov.cowin.befsale.clue.domain.clue.po.ClueCustomerCollect;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

/**
 * @Describe: 线索客户宽表_Manager接口层
 * @author: whp
 * @created: 2021-12-23 14:53:40
 * @version: 1.0
 */
public interface ClueCustomerCollectManager {

	/**
	 * 单条数据插入ClueCustomerCollect
	 * @param request
	 * @return 插入的条数
	 */
	int insert (ClueCustomerCollect request);

	/**
	 * 批量插入ClueCustomerCollect
	 * @param requests
	 * @return 批量插入的条数
	 */
    int insertBatch(List<ClueCustomerCollect> requests);

	/**
	 * 通过ID获取详细信息
	 *
	 * @param: id
	 * @return: ClueCustomerCollect对象
	 */
    ClueCustomerCollect getDetailById(Long id);

	/**
	 * 单条ClueCustomerCollect更新
	 * @param request
	 * @return 更新的条数
	 */
    int update(ClueCustomerCollect request);

	/**
	 * 单条ClueCustomerCollect更新
	 * @param request 参数
	 * @return 更新的条数
	 */
	int updateByIdAndUpdateTime(ClueCustomerCollect request);

	/**
	 * 通过ID删除数据
	 * @param id
	 * @return 删除的条数
	 */
    int delete(Integer id);

	/**
	 * 根据条件查询对象list列表
	 * @param request
	 * @return 查询结果
	 */
    List<ClueCustomerCollect> getListByParam(ClueCustomerCollect request);

	/**
	 * 根据条件查询对象page记录
	 * @param request
	 * @return
	 */
	Page<ClueCustomerCollect> getPageByParam(ClueCustomerCollect request, RowBounds rowBounds);

	/**
	 * 单条数据查询统计 ClueCustomerCollect
	 * @param request
	 * @return 插入的条数
	 */
	int getClueCustomerCollect(QueryClueCustomerCollectAllRequest request);

	/**
	 * 单条数据查询统计 ClueCustomerCollect
	 * @param request
	 * @return 插入的条数
	 */
	List<CountDateResponse> getClueCustomerCollectDate(QueryClueCustomerCollectAllRequest request);

	/**
	 * 头部部跟进内容统计
	 * @param request
	 * @return 头部部跟进内容统计
	 */
	List<ClueFollowHeadTypeResponse>  getClueFollowHeadTypeResponse(ClueCustomerCollect request);
	/**
	 * 线索状态头部部跟进内容统计
	 * @param request
	 * @return 头部部跟进内容统计
	 */

	List<ClueFollowHeadTypeResponse> getClueStatusHeadTypeResponse(QueryClueCustomerCollectAllRequest request);

	/**
	 * 根据条件查询对象分页对象
	 * @param request
	 * @return 查询结果
	 */
	Page<ClueCustomerCollect> getPageByParamAll(QueryClueCustomerCollectAllRequest request, RowBounds rowBounds);

	/**
	 * 单条ClueCustomerCollect更新
	 * @param request
	 * @return 更新的条数
	 */
	int updateByIds(ClueCustomerCollect request);


	/**
	 * 头部部战败审批统计
	 * @param request
	 * @return 头部部战败审批统计
	 */
	List<ClueFollowHeadTypeResponse> getClueFailFollowHeadTypeResponse(QueryClueCustomerCollectAllRequest request);


	/**
	 *头部部线索分配统计
	 *
	 */
	ClueDistributeResponse getClueDistributeResponse(QueryClueCustomerCollectAllRequest request);

	/**
	 * 线索宽表
	 * @param collectRequest 宽表请求参数
	 * @return 单个宽表信息
	 */
    ClueCustomerCollect getOneByParam(ClueCustomerCollect collectRequest);

	int updateByClueId(ClueCustomerCollect request);


	/**
	 * 总部逾期已跟进
	 * @param clueExpireRequest
	 * @return
	 */
	Page<ClueExpirePesponse> getOemClueExpireList(ClueExpireRequest clueExpireRequest, RowBounds rowBounds);
	/**
	 * 经销商逾期已跟进
	 * @param clueExpireRequest
	 * @return
	 */
	Page<ClueExpirePesponse> getDealerClueExpireList(ClueExpireRequest clueExpireRequest, RowBounds rowBounds);

	/**
	 * 更新宽表数据（经销商-> cusId + dealerId > 0 总部-> cusId + dealerId is null / = 0 = ''）
	 * @param request 更新参数
	 * @return 更新条数
	 */
    int updateByCusIdsAndDealerId(ClueCustomerCollect request);

	/**
	 * 根据条件查看显示未分配的数量
	 * add by zly
	 * @param clueIntentionGradeDataRequest
	 * @return
	 */
    Integer getDistributeCount(ClueIntentionGradeDataRequest clueIntentionGradeDataRequest);
}